﻿using System;
using System.Collections.Generic;

using Sustainalytics.Entities;
using Sustainalytics.Portfolios.BL.Model;
using Sustainalytics.Utils;

namespace Sustainalytics.Portfolios.BL
{
    public interface IPortfolioReadHandler
    {
        Portfolio GetPortfolioById(Guid id, PortfolioUserClaims userClaims);

        IList<Portfolio> GetPortfoliosByIds(ICollection<Guid> ids, PortfolioUserClaims userClaims);

        long GetPortfoliosCount(PortfolioFilter filter);

        IList<Guid> GetCompanyIdsByPortfolio(Guid portfolioId);

        List<PortfolioSecurityModel> GetPortfolioSecurities(Guid portfolioId, List<int> universe);

        IList<Portfolio> GetPortfolios(
            PortfolioFilter filter,
            int? skip = null,
            int? take = null,
            string[] orderBy = null,
            bool orderByAsc = true);

        IList<Portfolio> GetPortfoliosByCompanyId(
            Guid companyId,
            int? skip = null,
            int? take = null,
            string[] orderBy = null,
            bool orderByAsc = true);

        IList<PortfolioSecurityModel> GetPortfolioSecurities(
            Guid portfolioId,
            PortfolioUserClaims userClaims,
            int? skip = null,
            int? take = null,
            string[] orderBy = null,
            bool orderByAsc = true);

        IList<PortfolioSecurityModel> GetPortfolioSecurities(
            Guid portfolioId,
            out int totalCount,
            PortfolioUserClaims userClaims = null,
            int? skip = null,
            int? take = null,
            string[] orderBy = null,
            bool orderByAsc = true);

        IList<PortfolioSecurityModel> GetMatchedPortfolioSecurities(
            string portfolioName,
            Guid userId,
            out long totalCount,
            ListOptions listOptions,
            PortfolioUserClaims userClaims);

        IEnumerable<object> GetUnmatchedPortfolioSecurities(
            string portfolioName,
            Guid userId,
            out long totalCount,
            ListOptions listOptions,
            PortfolioUserClaims userClaims);

        string GetPortfolioNameById(Guid id);
    }
}